<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>设备信息维护查看详情</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="../../layuiadmin/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="../../layuiadmin/style/admin.css" media="all">
</head>
<body>
<div style="margin: 20px">
  <div class="basicInfo">
    <div class="record-formtitle">基本信息</div>
    <div class="layui-row form-row">
      <div class="layui-col-md6">
        <div class="layui-form-item">
          <div class="itemTr">站台名称:<span id="stationName"></span></div>
        </div>
        <div class="layui-form-item">
          <div class="itemTr">系统名称:<span id="systemValue"></span></div>
        </div>
        <div class="layui-form-item">
          <div class="itemTr">设备名称:<span id="productName"></span></div>
        </div>
      </div>
      <div class="layui-col-md6">
        <div class="layui-form-item">
          <div class="itemTr">专业:<span id="specialtyValue"></span></div>
        </div>
        <div class="layui-form-item">
          <div class="itemTr">类型:<span id="devTypeValue"></span></div>
        </div>
        <div class="layui-form-item">
          <div class="itemTr">维修方式:<span id="maintenanceFlag">计划维修</span></div>
        </div>
      </div>
    </div>
  </div>
  <div class="record-formtitle">维修记录</div>
  <table id="maintenanceRecord" lay-filter="maintenanceRecord"></table>
</div>
<script type="text/html" id="forTaskStatus">
  {{#  if(d.statu == '0'){d.statu = '已恢复'}}
  {{d.statu}}
  {{#  } else if (d.statu == '1'){d.statu = '处理中' }}
  {{d.statu}}
  {{#  } else if (d.statu == '2'){d.statu = '已搁置' }}
  {{d.statu}}
  {{#  } else if (d.statu == '3'){d.statu = '未处理' }}
  {{d.statu}}
  {{#  } else {d.statu = '已处理' }}
  {{d.statu}}
  {{#  } }}
</script>
<script src='../../layuiadmin/modules/jTools.js'></script>
<script src="../../layuiadmin/layui/layui.js"></script>
<script>
  function initData(data){
    debugger
    layui.config({
      base: '../../layuiadmin/' //静态资源所在路径
    }).extend({
      index: 'lib/index' //主入口模块
      , my_send: '../myModules/my_send'
    }).use(['index','equipment','form','laydate','table','my_send'], function () {
      var $ = layui.$
      , form = layui.form
      ,laydate = layui.laydate
      ,table = layui.table
      , my_send = layui.my_send
      , http_proxy = layui.http_proxy;
      function tdTitle(){
        $('th').each(function(index,element){
            $(element).attr('title',$(element).text());
        });
        $('td').each(function(index,element){
            $(element).attr('title',$(element).text());
        });
      };
      $('#stationName').html(data.stationName);
      $('#systemValue').html(data.systemName);
      $('#productName').html(data.etName);
      $('#specialtyValue').html(data.domain);
      $('#devTypeValue').html(data.etType);
       //维修记录
      table.render({
        elem: '#maintenanceRecord'
        , url: http_proxy('/alertManager/queryMtRecord') //数据接口
        , page: true //开启分页
        , method: 'post'
        , contentType : "application/json"
        ,id:'maintenanceRecord'
        ,request: {
          pageName: 'pageNo', //页码的参数名称，默认：page
          limitName: 'pageSize' //每页数据量的参数名，默认：limit
        }
        ,parseData:function(res){
          return{
            "code":0
            ,"count":res.total
            ,"data":res.rows
            ,'msg':''
          }
        }
        ,cols: [[
          {field: 'eventName', title: '设备名称'}
          ,{field: 'stationName', title: '站点名称'}
          ,{field: 'installPosition', title: '安装位置'}
          ,{field: 'lifeStatus', title: '生命周期状态',width: 100}
          ,{field: 'taskNum', title: '工单号'}
          ,{field: 'maintainDate', title: '维修日期',width: 100}
          ,{field: 'maintainWay', title: '维修方式'}
          ,{field: 'maintainPerson', title: '维修人'}
          ,{field: 'maintainContent', title: '维修内容'}
          ,{field: 'describe', title: '描述',width: 100}
          ,{field: 'taskStatus', title: '工单状态',width: 80, templet:'#forTaskStatus'}
          ,{field: 'createTime', title: '创建日期',width: 100}
          ,{field: 'createUserName', title: '创建人'}
        ]]
        ,where:{
          domain:data.domain,
          eventType:data.etType,
          systemName:data.systemName,
          stations:data.stationName
        }
        ,done:function(res){
          tdTitle();
        }
      });
    })
  }
</script>
</body>
</html>